<script>
    var idempleado;
    
    $(document).ready(function() {
        $("#window").kendoWindow({
        width: "300px",
        title: "",
        modal:true,
        visible:false,
        resizable: false
        });
    });
    
    function eliminarjs(id){
        var window=$("#window").data("kendoWindow");
        window.center();
        window.open();
        idrendimiento=id;
    }
    
    function cancelar(){
        
        var window = $("#window").data("kendoWindow");
        window.close();
        
    }
</script>
<div id="window"><p>¿Esta seguro que desea Eliminar El Rendimiento?</p>
    <a class="k-button"href="javascript:;" onclick="window.location.href=BASE_URL+'rendimiento/eliminarRendimiento/'+idrendimiento">Aceptar</a>
    <a class="k-button"onclick="cancelar()">Cancelar</a>
</div>
<fieldset style="width: 1080px;">    
    <h1>Tabla de Rendimiento</h1>
    <p style="margin: 20px 0 20px 0;">Lista todos los Rendimientos existentes, permite editar y dar de baja.</p>
</fieldset>

<fieldset style="width: 1080px;">
    <table id="tabla" cellspacing="0">
        
        <tr>
            <th class="elthini"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 1, keepRelationships: true})" style="color:#333333;">Fecha Inicio</a></th>
            <th class="elth"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 2, keepRelationships: true})" style="color:#333333;">Fecha Fin</a></th>
            <th class="elth"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 3, keepRelationships: true})" style="color:#333333;">Cliente</a></th>
            <th class="elth"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 4, keepRelationships: true})" style="color:#333333;">Especie</a></th>
            <th class="elth"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 5, keepRelationships: true})" style="color:#333333;">Tipo Corte</a></th>
            <th class="elth"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 7, keepRelationships: true, sortType: 'numeric'})" style="color:#333333;">Total M³</a></th>
            <th class="elth"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 8, keepRelationships: true, sortType: 'numeric'})" style="color:#333333;">Total P²</a></th>
            <th class="elth"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 9, keepRelationships: true, sortType: 'numeric'})" style="color:#333333;"></a>Rendimiento</th>
            <th class="elthfin">Borrar</th>
        </tr>
        <?php foreach($rendimientos as $i=>$id){ ?>
        <tr>
            <td class="eltd" style="width: 100px;"><?php echo $id['fecha_ini'] ?></td>
            <td class="eltd" style="width: 100px;"><?php echo $id['fecha_fin'] ?></td>
            <td class="eltd" style="width: 100px;"><?php echo $id['cliente'] ?></td>
            <td class="eltd" style="width: 100px;"><?php echo $id['nombre'] ?></td>
            <td class="eltd" style="width: 150px;"><?php echo $id['corte'] ?></td>
            <td class="eltd" style="width: 100px;"><?php echo $id['total_cubico'] ?></td>    
            <td class="eltd" style="width: 100px;"><?php echo $id['total_pie'] ?></td>
            <td class="eltd" style="width: 100px;"><?php echo $id['rendimiento'] ?></td>
            <td class="eltd" style="width: 100px;"><a href="javascript:;" title="Eliminar"  onclick="eliminarjs('<?php echo $id['idRendimiento']?>')"><img src="<?php echo base_url() ?>css/images/delete.png" alt="" /></a></td>
        </tr>
        <?php }?>
    </table>
</fieldset>

